<?php
// This is the login API call used to login a user to the mobile app. 

include '../RestRequest.php';
include '../RestUtils.php';
include '../SQL.php';
include '../../init.php';
 

$data = RestUtils::processRequest();

switch($data->getMethod())
{
	case 'get':	
		$user = (object) new user();		
		$RV = $data->getRequestVars();
		
		if($data->getHttpAccept() == 'json')
		{
			RestUtils::sendResponse(200,json_encode('test'),'application/json');
		}
		else  
		{
			RestUtils::sendResponse(200,json_encode(user::login($RV['username'],$RV['password'])),'text/html');
		}
}
 

?>